package com.stox.services.screener.screen.loser;

import com.stox.services.screener.model.AbstractScreenMatch;
import com.stox.shared.core.beans.annotation.Property;


public class LossScreenMatch extends AbstractScreenMatch {

	private final double initialPrice;
	private final double finalPrice;
	private final double loss;
	private final double lossPercentage;
	
	public LossScreenMatch(Long scripId, double initialPrice, double finalPrice) {
		super(scripId);
		this.initialPrice = initialPrice;
		this.finalPrice = finalPrice;
		this.loss = initialPrice - finalPrice;
		this.lossPercentage = loss*100/initialPrice;
	}

	@Property(index=0)
	public double getInitialPrice() {
		return initialPrice;
	}
	@Property(index=1)
	public double getFinalPrice() {
		return finalPrice;
	}
	@Property(index=2)
	public double getLoss() {
		return loss;
	}
	@Property(index=3, displayNameKey="LossPercentage")
	public double getLossPercentage() {
		return lossPercentage;
	}
	
}
